/*
 * app_start_thread.c
 *
 *  Created on: 2024�?6�?27�?
 *      Author: xhq
 */
/* include */
#include "app_thread_modules.h"

/* define */

/* typedef */

/* global varibles */

/* private function */

/* function */
/*****************************************************************************/
/**
*
* 第一次创建应用任�? first create thread
*
* @param	None.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
int first_create_thread(void)
{
    int32_t l_int32_ret = 0;

    /* 创建网络广播线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_NET_BROADCAST], NULL, app_net_broadcast_recv_thread, NULL);

    /* 创建网络接收线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_NET], NULL, app_net_recv_thread, NULL);

    /* 创建发送mipi数据线程*/
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_NET_SEND_MIPI], NULL, app_net_send_mipi_thread, NULL);

    /* 创建发送目标轨迹信息数据线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_NET_SEND_TRACK_INFO], NULL, app_net_send_info_thread, NULL);

    /* 创建发送DSP原始目标信息数据线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_NET_SEND_DSP_INFO], NULL, app_net_send_dsp_thread, NULL);

    return l_int32_ret;
}
/*****************************************************************************/
/**
*
* 第二次创建应用任�? second create thread
*
* @param	None.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
int second_create_thread(void)
{
    int32_t l_int32_ret = 0;

    /* 创建数据处理线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_DATA_PRO], NULL, app_data_pro_thread, NULL);

    /* 创建状态周期查询线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_STATUS], NULL, app_status_thread, NULL);

    /* 创建跟踪算法线程 */
    l_int32_ret = pthread_create(&g_pthread_pid[PTHREAD_GTRACK], NULL, gtarck_main_pthread, NULL);

    return l_int32_ret;
}